package com.zide.member.controller;

import com.zide.auth.utils.satoken.StpMemberUtil;
import com.zide.common.core.domain.CommonResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 石添
 * @date 2024/8/24
 */
@Slf4j
@RestController
@RequestMapping("member")
@Tag(name = "会员管理")
public class MemberUserController {

    @Operation(description = "获取会员信息")
    @GetMapping("profile")
    public CommonResult searchProfile() {
        boolean login = StpMemberUtil.isLogin();
        log.info("login===>{}",login);
        if(StpMemberUtil.isLogin()) {
            long loginIdAsLong = StpMemberUtil.getLoginIdAsLong();
            log.info("loginIdAsLong===>{}",loginIdAsLong);
        }
        return CommonResult.success("获取会员信息成功");
    }
}
